package org.example.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

import java.util.Date;

public class Aspect5 {

    public void afterThrowing(JoinPoint joinPoint, Throwable ex){
        //一旦发生异常，发送邮件或者短信给管理员
        System.out.println("++管理员您好，"+joinPoint.getTarget().getClass().getName()+"的方法："
                +joinPoint.getSignature().getName()+"发生了异常，异常为："+ex.getMessage());
    }

}
